package ex203;

import ex203.equation.QuadraticEquation;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        double a = input.nextDouble();
        double b = input.nextDouble();
        double c = input.nextDouble();

        QuadraticEquation equation = new QuadraticEquation(a, b, c);
        if (equation.getA() == 0) {
            System.out.println("不是一元二次方程");
        } else if (equation.getDiscriminant() < 0) {
            System.out.println("方程没有实根");
        } else if (equation.getDiscriminant() > 0) {
            System.out.printf("方程有2个不等的实根: %.2f和%.2f\n", equation.getRoot1(), equation.getRoot2());
        } else {
            System.out.printf("方程有2个相等的实根: %.2f\n", equation.getRoot1());
        }
    }
}
